/*
 * @Author: tkp
 * @Date: 2025-02-13 09:27:30
 */
import { strategyAdd, strategyModify, strategyDel, strategyQueryPage, strategyMenuAdd } from '@/utils/api'
export class IndexBloc {
    queryForm = {
        strategyName: '',
        enable: '',
    }
    enableLst = [{ label: '可用', value: 1 }, { label: '不可用', value: 0 }]
    pageNum = 1
    pageSize = 50
    total = 0
    addPop = false
    rowItem = ''
    editPop = false
    menuPop = false
    tableOption = [
        { label: '策略名称', prop: 'strategyName', },
        { label: '所属系统', prop: 'systemName', },
        { label: '描述', prop: 'description', },
        { label: '是否默认', prop: 'defaultFlag', slot: 'defaultFlag' },
        { label: '是否可用', prop: 'enable', slot: 'enable' },
    ]
    tableData = []
    load(data) {
        strategyQueryPage(data).then(res => {
            this.tableData = res.data.lst || []
            this.total = res.data.total || 0
        })
    }
    modify(data) {
        return strategyModify(data)
    }
    add(data) {
        return strategyAdd(data)
    }
    del(data) {
        return strategyDel(data)
    }
    saveStrategyMenu(data) {
        return strategyMenuAdd(data)
    }
}